package com.dylan.历史.多线程.并发编程的艺术.编程基础.模拟连接池;

import com.dylan.历史.util.SleepUtils;

import java.util.Random;

/**
 * 模拟连接
 */
public class Connection {
    private String name;

    public Connection(String name) {
        this.name = name;
    }

    public void execute() {
        SleepUtils.milliseconds(new Random().nextInt(200));
    }

    public String getName() {
        return name;
    }
}
